<template>
  <div class="wrapper">
    <div class="box">
      <div class="logo_box">
        <p>京源睿谷生态科技城</p>
        <p>统一门户登录</p>
      </div>
      <div class="inputs">
        <div>
          <el-input placeholder="请输入用户名" prefix-icon="el-icon-user-solid" v-model="userName" maxlength="10" clearable>
          </el-input>
        </div>
        <div>
          <el-input placeholder="请输入密码" prefix-icon="el-icon-lock" v-model="passWord" maxlength="10" show-password
            @keyup.enter.native="sub_btn">
          </el-input>
        </div>

        <div class="sub">
          <button @click="sub_btn">登录</button>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
// import  loding from '@/views/login/loding'
export default {
  data() {
    return {
      userName: "",
      passWord: "",
    };
  },
  created() { },
  methods: {
    sub_btn() {
      if (this.userName == "" && this.passWord == "") {
        this.$message({
          message: "您好，还未输入账号信息。",
          type: "warning",
        });
        return;
      }
      if (this.userName == "" || this.passWord == "") {
        this.$message({
          message: "账号或密码不能为空。",
          type: "warning",
        });
        return;
      }
      if (this.userName == "admin" && this.passWord == 123456) {
        this.$message({
          message: "登录成功。",
          type: "success",
        });
        // setTimeout(() => { //倒计时
        this.$router.replace({ path: "/home" });
        // }, 1500);
        return;
      } else {
        this.$message({
          message: "账号或密码错误。",
          type: "error",
        });
      }
    },
  },
};
</script>
<style>
.wrapper {
  width: 100vw;
  height: 100vh;
  background: url(@/assets/imgs/shouye.png) no-repeat;
  background-size: 100% 100%;
}

.box {
  width: 4.28rem;
  height: 4.91rem;
  border: 0.01rem solid #ccc;
  background-color: #f5f5f5;
  margin: 0 auto;
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  border-radius: 0.2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 0.15rem 0.2rem;
}

.box::before {
  display: inline-block;
  letter-spacing: 0.35rem;
  /* border: .01rem solid #000; */
  width: 1rem;
  height: 1rem;
  position: absolute;
  top: -1rem;
  left: 50%;
  margin-left: -0.5rem;
}

.logo_box {
  width: 3rem;
  height: 1rem;
  color: #1269ff;
  /* border: 1px solid #ccc; */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0.4rem 0 0.154rem 0;
}

.logo_box p {
  font-size: 0.3rem;
  text-align: center;
}

.inputs {
  /* border:.01rem solid #000; */
  margin-top: 0.15rem;
  font-size: 0.18rem;
  font-weight: normal;
  text-align: left;
}

.inputs>div {
  margin: 0.1rem 0;
  margin-bottom: 0.2rem;
}

.inputs>div input {
  font-size: 0.18rem;
  border: 1px solid #337dfd;
  padding-left: 0.1rem;
}

.sub {
  width: 100%;
  height: 0.4rem;
}

.sub button {
  width: 100%;
  height: 0.4rem;
  background-color: #1269ff;
  margin-top: 0.3rem;
  border: none;
  cursor: pointer;
  color: #fff;
  border-radius: 0.05rem;
}

p {
  width: 100%;
  font-size: 0.14rem;
  text-align: right;
}

p>a {
  color: red;
}

.tip_box {
  width: 1rem;
  height: 1rem;
  /* border: .01rem solid #000; */
  position: absolute;
  top: -1.5rem;
  left: 56%;
  font-size: 0.72rem;
  font-weight: normal;
  background-size: 100% 100%;
  padding: 0.15rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.tip_box p {
  font-size: 0.08rem !important;
  width: 0.6rem;
  text-align: left;
  position: absolute;
  top: 0;
  margin-top: 0.2rem;
}
</style>